using AutoMapper;
using Pay.DTO;
using Pay.Data;
using Pay.IService;

namespace Pay.Service.AutoMapper
{
    public class UserComsumeHisMapper : IStartupDto
    {
        private IMapperConfigurationExpression _cfg;
        public UserComsumeHisMapper(IMapperConfigurationExpression cfg)
        {
            _cfg = cfg;
        }
        public void Execute()
        {
            Create();
        }
        protected virtual void Create()
        {
            _cfg.CreateMap<UserComsumeHis, user_comsume_his_dto>()
                .ForMember(dest => dest.id, src => src.MapFrom(c => c.Id))
                .ForMember(dest => dest.user_id, src => src.MapFrom(c => c.UserId))
                .ForMember(dest => dest.consume_type, src => src.MapFrom(c => c.ConsumeType))
                .ForMember(dest => dest.info, src => src.MapFrom(c => c.Info))
                .ForMember(dest => dest.product_id, src => src.MapFrom(c => c.ProductId))
                .ForMember(dest => dest.order_no, src => src.MapFrom(c => c.OrderNo))
                .ForMember(dest => dest.consume_red_drill, src => src.MapFrom(c => c.ConsumeRedDrill))
                .ForMember(dest => dest.recharge_amount, src => src.MapFrom(c => c.RechargeAmount))
                .ForMember(dest => dest.status, src => src.MapFrom(c => c.Status))
                .ForMember(dest => dest.create_time, src => src.MapFrom(c => c.CreateTime))
                .ForMember(dest => dest.ship_adress_id, src => src.MapFrom(c => c.ShipAdressId))
                .ForMember(dest => dest.merchant, src => src.MapFrom(c => c.Merchant));
        }
    }
}
